import http from '@/utils/request'
//  获取终端信息列表
export const getClientList = (data, config) => {
	return http.get('/client/management/clientcontroller/page', {params: data}, config)
}
// 获取终端场景列表
export const getSceneList = (data, config) => {
	return http.get('/client/management/scene/page', {params: data}, config)
}

// 获取终端场景详情
export const getBySceneId = (data, config) => {
	return http.get('/client/management/scene/getBySceneId', {params: data}, config)
}

// 保存终端场景详情
export const saveScene = (data, config) => {
	return http.post('/client/management/scene/save', data, config)
}

// 获取弹幕列表
export const getCaptions = (data, config) => {
	return http.get('/client/management/captions/page', {params: data}, config)
}
// 打开或关闭弹幕
export const openOrClose = (data, config) => {
	return http.post('/client/management/captions/openOrClose',data, config)
}
// 保存弹幕
export const saveCaptions = (data, config) => {
	return http.post('client/management/captions/save',data, config)
}
// 获取布局列表
export const getLayoutList = (data, config) => {
	return http.get('/client/management/scene/layoutList', {params: data}, config)
}
// 指令发送
export const instructSend = (data, clientDetail=null, config) => {
  let client = {}
  if(clientDetail=== null || clientDetail === undefined) {
    client = JSON.parse(localStorage.getItem('clientDetail'))
  } else {
    client = {...clientDetail}
  }
  let tmp = {
    instruct: data,
    address: client.ip,
    port: 9191,
    size: 10240
  }
  return http.post('/client/instruct/send', tmp, config)
}

export const quicklySend = (data, config) => {
  return http.post('/sendfile/media/send-record/create', data, config)
}
//  获取发送记录
export const getSendFileRecord = (data, config) => {
  let url = `/sendfile/media/send-record/page`
  return http.post(url, data, config)
}

export const getToken = (data, config) => {
  return http.post('/sys/user/getToken', data, config)
}
